home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / views / Read.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  6.5 KB  |  226 lines

  1. package views
  2. {
  3.    import com.arpitonline.controls.ScrollImage;
  4.    import flash.accessibility.*;
  5.    import flash.debugger.*;
  6.    import flash.display.*;
  7.    import flash.errors.*;
  8.    import flash.events.*;
  9.    import flash.external.*;
  10.    import flash.filters.*;
  11.    import flash.geom.*;
  12.    import flash.media.*;
  13.    import flash.net.*;
  14.    import flash.printing.*;
  15.    import flash.profiler.*;
  16.    import flash.system.*;
  17.    import flash.text.*;
  18.    import flash.ui.*;
  19.    import flash.utils.*;
  20.    import flash.xml.*;
  21.    import mx.binding.*;
  22.    import mx.containers.Canvas;
  23.    import mx.core.UIComponentDescriptor;
  24.    import mx.core.mx_internal;
  25.    import mx.events.PropertyChangeEvent;
  26.    import mx.styles.*;
  27.    
  28.    public class Read extends Canvas
  29.    {
  30.       private static var _watcherSetupUtil:IWatcherSetupUtil;
  31.       
  32.       private var _bindings:Array;
  33.       
  34.       [Bindable]
  35.       private var _95458899debug:String;
  36.       
  37.       public var _bindingsByDestination:Object;
  38.       
  39.       private var lastX:int = 0;
  40.       
  41.       private var lastY:int = 0;
  42.       
  43.       [Bindable]
  44.       private var _2044922510scrollImage:ScrollImage;
  45.       
  46.       public var _bindingsBeginWithWord:Object;
  47.       
  48.       private var mouseIsDown:Boolean = false;
  49.       
  50.       [Bindable]
  51.       private var _859611628imageURL:String;
  52.       
  53.       private var scrollHeight:int;
  54.       
  55.       private var imgHeight:int;
  56.       
  57.       private var scrollWidth:int;
  58.       
  59.       private var _watchers:Array;
  60.       
  61.       private var imgWidth:int;
  62.       
  63.       private var _documentDescriptor_:UIComponentDescriptor;
  64.       
  65.       public function Read()
  66.       {
  67.          _documentDescriptor_ = new UIComponentDescriptor({
  68.             "type":Canvas,
  69.             "propertiesFactory":function():Object
  70.             {
  71.                return {"childDescriptors":[new UIComponentDescriptor({
  72.                   "type":ScrollImage,
  73.                   "id":"scrollImage",
  74.                   "stylesFactory":function():void
  75.                   {
  76.                      this.borderThickness = 0;
  77.                   },
  78.                   "propertiesFactory":function():Object
  79.                   {
  80.                      return {
  81.                         "percentHeight":100,
  82.                         "percentWidth":100
  83.                      };
  84.                   }
  85.                })]};
  86.             }
  87.          });
  88.          lastX = 0;
  89.          lastY = 0;
  90.          mouseIsDown = false;
  91.          super();
  92.          mx_internal::_document = this;
  93.          this.percentWidth = 100;
  94.          this.percentHeight = 100;
  95.          this.horizontalScrollPolicy = "off";
  96.          this.verticalScrollPolicy = "off";
  97.       }
  98.       
  99.       public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
  100.       {
  101.          Read._watcherSetupUtil = param1;
  102.       }
  103.       
  104.       public function set imageURL(param1:String) : void
  105.       {
  106.          var _loc2_:Object = null;
  107.          _loc2_ = this._859611628imageURL;
  108.          if(_loc2_ !== param1)
  109.          {
  110.             this._859611628imageURL = param1;
  111.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imageURL",_loc2_,param1));
  112.          }
  113.       }
  114.       
  115.       private function _Read_bindingsSetup() : void
  116.       {
  117.          var binding:Binding = null;
  118.          if(!_bindings)
  119.          {
  120.             _bindings = [];
  121.          }
  122.          if(!_watchers)
  123.          {
  124.             _watchers = [];
  125.          }
  126.          binding = new Binding(this,function():String
  127.          {
  128.             var _loc1_:* = undefined;
  129.             var _loc2_:* = undefined;
  130.             _loc1_ = "images/large/" + imageURL;
  131.             return _loc1_ == undefined ? null : String(_loc1_);
  132.          },function(param1:String):void
  133.          {
  134.             scrollImage.source = param1;
  135.          },"scrollImage.source");
  136.          _bindings[0] = binding;
  137.       }
  138.       
  139.       private function set debug(param1:String) : void
  140.       {
  141.          var _loc2_:Object = null;
  142.          _loc2_ = this._95458899debug;
  143.          if(_loc2_ !== param1)
  144.          {
  145.             this._95458899debug = param1;
  146.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"debug",_loc2_,param1));
  147.          }
  148.       }
  149.       
  150.       override public function set visible(param1:Boolean) : void
  151.       {
  152.          super.visible = param1;
  153.          if(Boolean(scrollImage) && param1)
  154.          {
  155.             scrollImage.zero();
  156.          }
  157.       }
  158.       
  159.       private function imageInit(param1:Event) : void
  160.       {
  161.          trace("imageInit for " + this);
  162.          param1.target.x = 0;
  163.          param1.target.y = 0;
  164.          imgWidth = param1.target.contentWidth;
  165.          imgHeight = param1.target.contentHeight;
  166.          param1.target.width = imgWidth;
  167.          param1.target.height = imgHeight;
  168.       }
  169.       
  170.       public function set scrollImage(param1:ScrollImage) : void
  171.       {
  172.          var _loc2_:Object = null;
  173.          _loc2_ = this._2044922510scrollImage;
  174.          if(_loc2_ !== param1)
  175.          {
  176.             this._2044922510scrollImage = param1;
  177.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"scrollImage",_loc2_,param1));
  178.          }
  179.       }
  180.       
  181.       [Bindable(event="propertyChange")]
  182.       public function get imageURL() : String
  183.       {
  184.          return this._859611628imageURL;
  185.       }
  186.       
  187.       [Bindable(event="propertyChange")]
  188.       private function get debug() : String
  189.       {
  190.          return this._95458899debug;
  191.       }
  192.       
  193.       [Bindable(event="propertyChange")]
  194.       public function get scrollImage() : ScrollImage
  195.       {
  196.          return this._2044922510scrollImage;
  197.       }
  198.       
  199.       private function _Read_bindingExprs() : void
  200.       {
  201.          var _loc1_:* = undefined;
  202.          _loc1_ = "images/large/" + imageURL;
  203.       }
  204.       
  205.       override public function initialize() : void
  206.       {
  207.          var target:Read = null;
  208.          var watcherSetupUtilClass:Object = null;
  209.          mx_internal::setDocumentDescriptor(_documentDescriptor_);
  210.          _Read_bindingsSetup();
  211.          target = this;
  212.          if(_watcherSetupUtil == null)
  213.          {
  214.             watcherSetupUtilClass = getDefinitionByName("_views_ReadWatcherSetupUtil");
  215.             watcherSetupUtilClass["init"](null);
  216.          }
  217.          _watcherSetupUtil.setup(this,function(param1:String):*
  218.          {
  219.             return target[param1];
  220.          },_bindings,_watchers);
  221.          super.initialize();
  222.       }
  223.    }
  224. }
  225.  
  226.